<template>
    <div class="WheatPestImg">
        <!-- 选择器 -->
        <el-row class="select">
            <!-- 面包屑导航栏 -->
            <el-col :span="15">
                <el-breadcrumb separator-class="el-icon-arrow-right">
                    <el-breadcrumb-item :to="{ path: '/CkbPestManager' }">小麦虫害</el-breadcrumb-item>
                    <el-breadcrumb-item>虫害详情</el-breadcrumb-item>
                </el-breadcrumb>
            </el-col>
            <!-- 搜索数据输入框 -->
            <el-col :span="1">
                <h5 class="textStyle">搜索数据</h5>
            </el-col>
            <el-col :span="6">
                <el-input placeholder="请输入内容" v-model="searchInput" clearable class="inputStyle">
                </el-input>
            </el-col>
            <!-- 查询按钮 -->
            <el-col :span="1">
                <el-button type="primary" icon="el-icon-search" @click="searchInfo">查询</el-button>
            </el-col>
        </el-row>
        <el-divider></el-divider>
        <el-empty v-if="$store.state.rowWheatDiseaseInfo.length === 0" description="请选择设备与时间段" :image-size="300"
            class="emptyImg"></el-empty>
        <!-- 卡片显示 -->
        <el-row v-else class="cards">
            <el-col :span="4" v-for="(o, index) in allDeviceInfo.img_Url_List.slice(1, -1).split(',')" :key="index"
                :offset="index > 0 ? 0.5 : 0">
                <el-card :body-style="{ padding: '0px' }" @click.native="setClickInfo">
                    <img :src="o" class="image">
                </el-card>
            </el-col>
        </el-row>
        <!-- 信息显示 -->
        <div class="info">
            <div class="title">
                <h5>分析报告</h5>
            </div>
            <div class="contents">
                <p><span>名称：</span>{{ $store.state.rowWheatDiseaseInfo.name }}</p>
                <p><span>损伤状况：</span>{{ $store.state.rowWheatDiseaseInfo.damage_Condition }}</p>
                <p><span>疾病病原体介绍：</span>{{ $store.state.rowWheatDiseaseInfo.disease_Pathogen }}</p>
                <p><span>方法：</span>{{ $store.state.rowWheatDiseaseInfo.farm_Method }}</p>
                <p><span>发病因素：</span>{{ $store.state.rowWheatDiseaseInfo.law_Of }}</p>
                <p><span>虫害位置：</span>{{ $store.state.rowWheatDiseaseInfo.part_Names }}</p>
                <p><span>出现时期：</span>{{ $store.state.rowWheatDiseaseInfo.periods }}</p>
            </div>
        </div>
    </div>
</template>

<script>
export default {
    name: 'WheatPestImg',
    data() {
        return {
            allDeviceInfo: [],
            filterDeviceInfo: [],
            searchInput: '',
            rowID: -1,
        }
    },
    methods: {
        searchInfo() {
            this.filterDeviceInfo = this.allDeviceInfo
        }
    },
    created() {
        this.allDeviceInfo = this.$store.state.rowWheatDiseaseInfo
        console.log("--------------------")
        console.log(this.allDeviceInfo)
        console.log(this.allDeviceInfo.img_Url_List)
        console.log("--------------------")
        console.log(this.allDeviceInfo.img_Url_List.slice(1, -1).split(','))
    }
}
</script>

<style scoped lang="less">
.WheatPestImg {
    padding: 0px 15px;

    .select .el-col {
        display: flex;

        .el-breadcrumb {
            line-height: 40px;
        }

        ::v-deep .el-button--primary {
            background-color: rgb(4, 17, 35);
        }

    }

    .inputStyle {
        padding-right: 20px;
    }

    .textStyle {
        line-height: 40px;
    }

    .emptyImg {
        padding-top: 150px;
    }

    .cards {
        width: 100%;
        height: 390px;
        margin-top: 15px;
        overflow: auto;
        margin-bottom: 20px;

        .el-col {
            padding-right: 15px;
        }

        .el-card {
            margin-right: 15px;
            margin-bottom: 20px;
            margin-bottom: 20px;
            width: 100%;

            .image {
                aspect-ratio: 1 / 1;
                width: 100%;
                display: block;
            }

            .bottom {
                margin-top: 13px;
                line-height: 12px;

                .timeFont {
                    font-size: 15px;
                    color: #999;
                }
            }

            .clearfix:before,
            .clearfix:after {
                display: table;
                content: "";
            }

            .clearfix:after {
                clear: both
            }
        }
    }

    .info {
        width: 100%;
        height: 350px;
        background-color: rgb(4, 17, 35);

        .title {
            height: 45px;
            h5 {
                font-size: 18px;
                padding: 10px 0px 10px 20px;
                border-left: #fff 3px solid;
                margin-left: 20px;
                color:#fff
            }
        }

        .contents {
            height:300px;
            overflow: auto;
            color: #fff;
            p {
                font-size: 16px;
                padding: 5px 43px;
                // color:black
                span {
                    color: orange;
                }
            }
        }
    }
}
</style>